package com.lzj.demo.design.common;


import lombok.Setter;

public enum ServerResultCode implements ErrorInfo {
    //成功 "0"
    SUCCESS(0, "成功"),
    FAIL(1000, "系统内部错误,请联系业务系统运维管理员"),
    //空指针异常
    NULL_POINT(1001, "空指针异常"),
    //校验异常
    RUN_ERROR(1002, "程序运行报错"),
    ILLEGAL_ARGUMENT(1003, "参数非法"),
    FILED_ERROR(1004, "传入参数错误"),
    PARAM_ERROR(1005, "入参为空"),
    EMPTY_RESULT(1006, "数据不存在"),
    EMPTY_LIST(1007, "查询结果为空"),
    // 服务熔断
    SERVICE_FUSING_ERROR(1100, "服务已熔断"),
    UPLOAD_OSS_EXCEPTION(1101, "文件上传失败"),
    ;

    ServerResultCode(Integer errorCode, String errorDesc) {
        this.errorCode = errorCode;
        this.errorDesc = errorDesc;
    }

    @Setter
    private Integer errorCode;
    @Setter
    private String errorDesc;

    @Override
    public Integer getErrorCode() {
        return this.errorCode;
    }

    @Override
    public String getErrorDesc() {
        return this.errorDesc;
    }
}